<?php 

/**
* 货品模型
*/
class GoodsListModel extends Model{
	// 设置模型对象
	public $table="goods_List";
	/**
	 * [get_data 获取货品信息]
	 * @return [type] [description]
	 */
	public function get_data($where=NULL){
		return $this->where($where)->all();
	}
	/**
	 * [add_data 增加货品的方法]
	 */
	public function add_data($data){
		$combine = implode(',', Q('post.spec',0,"intval"));
		$this->data['combine']=$combine;
		$this->data['tprice']=$data;
		return $this->add();
	}
	/**
	 * [get_one_data 获取一条数据]
	 * @param  [type] $where [description]
	 * @return [type]        [description]
	 */
	public function get_one_data($where = NULL){
		return $this->where($where)->find();
	}
	/**
	 * [del_data 删除数据]
	 * @param  [type] $cid [description]
	 * @return [type]      [description]
	 */
	public function del_data($where=NULL){
		return $this->where($where)->delete();
	}
	/**
	 * [update_data 更新商品]
	 * @return [type] [description]
	 */
	public function update_data($where){
		$this->where($where)->save();
	}
	
}

 ?>